package com.redwolfsoft.libshoppingserver.favorite;

import net.sf.json.JSONObject;



public class FavoriteBrandItemInfo {
	public final static String TAG = "FavoriteBrandItemInfo";
	
	private String brandId;
	private String brandName;
	private String imageUrl;
	
	public FavoriteBrandItemInfo()
	{}
	
	public FavoriteBrandItemInfo(String brandId,String brandName,String imageUrl)
	{
		this.brandId=brandId;
		this.brandName=brandName;
		this.imageUrl=imageUrl;
	}
	
	public FavoriteBrandItemInfo(JSONObject obj)
	{
		if(obj==null)
		{
			//Log.w(TAG, "JSONObject is null");
			return;
		}
		//try {	
			brandId = obj.getString("brandId");
			brandName = obj.getString("brandName");
			imageUrl = obj.optString("imageUrl");
			
		//} catch (JSONException e) {			
		//	e.printStackTrace();
		//}
	}
	public JSONObject toJsonObject()
	{
		JSONObject obj = new JSONObject();
		//JSONObject obj2 = new JSONObject();
		//try {
			obj.put("brandId", brandId);
			obj.put("brandName", brandName);
			obj.put("imageUrl", imageUrl);
			
			//obj2.put(TAG, obj);
		//} catch (JSONException e) {
			// TODO Auto-generated catch block
		//	e.printStackTrace();
		//	return null;
		//}
		return obj;
		
	}
	
	public String getBrandId() {
		return brandId;
	}

	public void setBrandId(String brandId) {
		this.brandId = brandId;
	}

	public String getBrandName() {
		return brandName;
	}

	public void setBrandName(String brandName) {
		this.brandName = brandName;
	}

	public String getImageUrl() {
		return imageUrl;
	}

	public void setImageUrl(String imageUrl) {
		this.imageUrl = imageUrl;
	}

	@Override
	public String toString() {
		return "FavoriteBrandItemInfo [brandId=" + brandId + ", brandName="
				+ brandName + ", imageUrl=" + imageUrl + "]";
	}
	
	
	

}
